package Tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import StringHandling.StringStripper;

public class StringStripperShould {
	
	StringStripper stripper = new StringStripper();
	String testString = "\n[19:16:18] Herne's Three Round Burst hits (Normal) Batab Crusher for 694 physical damage. (Normal)" ;
	String testString2 = "[20:57:28] MadMicky's Striker hits (Normal) Wayeb-Xul, the Hound of the Nameless Days for 1960 physical damage. (Blocked)";
	String testString3 = "[17:00:27] Recursia, Many-In-One's Attack hits (Normal) Lexx for 1093 magical damage. (Normal)";
	String testString4 = "[16:56:50] Your CQC hits (Normal) Recursia, Many-In-One for 5 physical damage. (Normal)";
	String testString5 = "[21:13:52] Cassius, Hadean Guard's Chirurgy heals Brutus, Hadean Guard for 11276.";
	String testString6 = "[20:57:27] (Critical) MadMicky's Striker hits (Normal) Wayeb-Xul, the Hound of the Nameless Days for 4416 physical damage. (Normal)";
	String testString7 = "[21:37:43] Walloittaja's Safety Off hits (Normal) Eblis, Dominus Inferni In Profondis for 486 physical damage. (Penetrated)";
	String testString8 = "[21:37:50] Eblis, Dominus Inferni In Profondis's Attack hits (Normal) Rellyk for 1308 physical damage. (Normal)";
	String healTest1 = "[21:07:52] Your Empowerment heals Herne for 683.";
	String healTest2 = "[21:07:52] (Critical) Your Cauterise heals Rellyk for 100.";
	String healTest3 = "[21:13:52] Cassius, Hadean Guard's Chirurgy heals Brutus, Hadean Guard for 11276.";
	
	String buffString = "[19:16:18] You gain buff Fury";

	@Test
	public void stripAPlayersFullName() {
		
		System.out.println("\nPlayers:");
		System.out.println(stripper.stripCombatName(testString));
		System.out.println(stripper.stripCombatName(testString2));
		System.out.println(stripper.stripCombatName(testString3));
		System.out.println(stripper.stripCombatName(testString5));
		System.out.println(stripper.stripCombatName(testString6));
		System.out.println(stripper.stripCombatName(testString7));
		System.out.println(stripper.stripCombatName(testString8));
		System.out.println("HT1" + stripper.stripCombatName(healTest1));
		System.out.println("HT2" + stripper.stripCombatName(healTest2));
		System.out.println("HT3" + stripper.stripCombatName(healTest3));
		System.out.println(stripper.stripCombatName(testString4 + "\n"));
		
		assertEquals("Herne",stripper.stripCombatName(testString));

	}
	
	@Test
	public void stripATargetsName() {
		System.out.println("\nTargets:");
		System.out.println(stripper.stripCombatTargetName(testString));
		System.out.println(stripper.stripCombatTargetName(testString2));
		System.out.println(stripper.stripCombatTargetName(testString3));
		System.out.println(stripper.stripCombatTargetName(testString7));
		System.out.println(stripper.stripCombatTargetName(testString8));
		System.out.println("Heal target 1: " + stripper.stripHealTargetName(healTest1));
		System.out.println("Heal target 2: " + stripper.stripHealTargetName(healTest2));
		System.out.println("Heal target 3: " + stripper.stripHealTargetName(healTest3));
		System.out.println(stripper.stripCombatTargetName(testString4 + "\n"));
		assertEquals("Batab Crusher", stripper.stripCombatTargetName(testString));
		
	}
	
	@Test
	public void stripDamageCorrectly() {
		System.out.println("\nDamage:");
		System.out.println("Damage: " + stripper.stripDamage(testString));
		System.out.println("Damage: " + stripper.stripDamage(testString2));
		System.out.println("Damage: " + stripper.stripDamage(testString3));
		System.out.println("Damage: " + stripper.stripDamage(testString4));
		assertEquals(694, stripper.stripDamage(testString));
	}
	
	@Test
	public void stripTimeCorrectly() {
		System.out.println("\nTime:");
		System.out.println("Time: " + stripper.stripTime(testString));
		System.out.println("Time " + stripper.stripTime(testString2));
		System.out.println("Time: " + stripper.stripTime(testString3));
		System.out.println("Time " + stripper.stripTime(testString4));
		assertEquals(69378, stripper.stripTime(testString));
	}
	
	@Test
	public void stripBuffCorrectly() {
		System.out.println("\nBuff:");
		System.out.println("Buff: " + stripper.stripBuffAbilityName(buffString));
		assertEquals("Fury", stripper.stripBuffAbilityName(buffString));
	}
}
